/*
 * Utils.h
 *
 *  Created on: 19/05/2014
 *      Author: javier
 */

#ifndef UTILS_H_
#define UTILS_H_

#include <vector>
#include <string>

class Utils {
public:
	Utils();
	virtual ~Utils();
	static void printHello();
	static int stringToInt(std::string s);
	static std::string intToString(int n);
	static double stringToDouble(std::string s);
	static std::string doubleToString(double n);
	static std::vector<std::string> split(const std::string &s, char delim);
	static std::vector<std::string>& split(const std::string &s, char delim,
			std::vector<std::string> &elems);
	static std::string pasarLongACadena(long numero);
	static void replaceAll(std::string& str, const std::string& from, const std::string& to);
	static double absoluteValue(double val) {
		if (val < 0)
			return -val;
		return val;
	};
};

// Clase de ayuda para obtener los indices del vector de sprites
class Cycler {
public:
	Cycler(int n);
	int next();
	virtual ~Cycler();
private:
	int ant, act, tam;
};

#endif /* UTILS_H_ */
